<script>
function getSearchBasic(str,ten_sp,id_loai,catList,s_a)
{
	
	if (str.length==0)
	  {
	  document.getElementById("resultBasic").innerHTML="";
	  //document.getElementById("sortdiv").style.border="0px";
	  return;
	  }
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 
	xmlhttp.onreadystatechange=function()
  	{
		 if (xmlhttp.readyState == 4) {
			// only if "OK"
			if (xmlhttp.status == 200) {						
				document.getElementById('resultBasic').innerHTML=xmlhttp.responseText;				
				document.getElementById("sortList2").value = str;
			} else {
				alert("There was a problem while using XMLHTTP:\n" + xmlhttp.statusText);
			}
		}				
	 
 	 }
	 
	xmlhttp.open("GET","../view/getsortbasic.php?ten_sp="+ten_sp+"&loai_sp_search="+id_loai+"&list_loai_sp="+catList+"&s_a="+s_a+"&sort="+str,true);	
	xmlhttp.send();
}
</script>
<?
$sort = $_GET['sort'];
if($sort == "asc"){
	$selectAsc = "selected";
	$selectDesc = "";
}else{
	$selectAsc = "";
	$selectDesc = "selected";
}
?>
<div style="float:right; margin-right:5px; padding-top:23px;">
<select  name="sortList" onChange="getSearchBasic(this.value,'<?=$_SESSION['ten_sp']?>','<?=$_SESSION['loai_sp_search']?>','<?=$_SESSION['listCatSP_Hidden']?>','')" style="border:1px solid #FF0000; ">
<option value="desc" <?=$selectDesc?>>Giá giảm dần</option>
<option value="asc" <?=$selectAsc?>>Giá tăng dần</option>
<input type="hidden" name="sortList2" value="<?=$sort?>" id="sortList2">
</select>

</div>